package com.tender.controller.demo;

import com.alibaba.fastjson.JSON;
import com.tender.common.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/demo")
public class DemoController {

    /**
     * 前端传参：["1","2"]
     */
    @PostMapping(value = "/list/input", consumes = "application/json")
    public Result<String> listParam(@RequestBody List<String> list) {
        log.info("list = {}", JSON.toJSONString(list));
        return Result.success("success");
    }

}
